package com.wisezone.workflow.dao;

import java.util.List;

import com.wisezone.common.dao.BaseDao;
import com.wisezone.workflow.bean.WfProcessDefinition;
import com.wisezone.workflow.bean.WfVariable;
import com.wisezone.workflow.exception.WfDaoException;

/**
 * 变量接口
 * 
 * @author tss 2009-09-05
 * 
 */
public interface WfVariableDao extends BaseDao {

	/**
	 * 获得流程变量
	 * 
	 * @param processDefId
	 * @return
	 * @throws WfDaoException
	 */
	public List<WfVariable> getProcessVariableList(Long processDefId)
			throws WfDaoException;

	/**
	 * 获得活动变量
	 * 
	 * @param activityId
	 * @return
	 * @throws WfDaoException
	 */
	public List<WfVariable> getActivityVariableList(Long activityId)
			throws WfDaoException;

	/**
	 * 获得流程模板变量
	 * 
	 * @param processDefId
	 * @param name
	 * @return
	 * @throws WfDaoException
	 */
	public WfVariable getProcessEntity(Long processDefId, String name)
			throws WfDaoException;

	/**
	 * 获得活动变量
	 * 
	 * @param s
	 * @param aiId
	 * @return
	 * @throws WfDaoException
	 */
	public WfVariable getActivityEntity(Long activityId, String name)
			throws WfDaoException;

	/**
	 * 保存或修改流程变量
	 * 
	 * @param variable
	 * @param processDefinition
	 * @throws WfDaoException
	 */
	public void saveOrUpdate(WfVariable variable,
			WfProcessDefinition processDefinition) throws WfDaoException;

	/**
	 * 删除流程变量
	 * 
	 * @param variable
	 * @param processDefinition
	 * @throws WfDaoException
	 */
	public void delete(WfVariable variable,
			WfProcessDefinition processDefinition) throws WfDaoException;

	/**
	 * 根据流程模板Id删除
	 * 
	 * @param id
	 * @throws WfDaoException
	 */
	public void deleteByProcessDefId(Long id) throws WfDaoException;

}